<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>批量改变对象属性</title>
	</head>
	<body>
		<p>给定一个构造函数 constructor，请完成 alterObjects 方法，将 constructor 的所有实例的 greeting 属性指向给定的 greeting 变量。 </p>
		<p>输入例子:var C = function(name) {
			this.name = name; return this;
			}; 
			var obj1 = new C('Rebecca'); 
			alterObjects(C, 'What\'s up'); 
			obj1.greeting;</p>
		<p>输出例子:What's up</p>
		<p>
			function alterObjects(constructor, greeting) {
				
			}
		</p>
		<script type="text/javascript">
			function alterObjects(constructor, greeting) {
				constructor.prototype.greeting=	greeting;
			}
			var C = function(name) {
			this.name = name; return this;
			}; 
			var obj1 = new C('Rebecca'); 
			alterObjects(C, 'What\'s up'); 
		</script>
		
		
	</body>
</html>
